<?php
/**
 * All member index page
 * หน้าแสดง member ทั้งหมด และเมนูสำหรับเข้าจัดการ
 * @package Member
 * @subpackage View
 * @category view
 */
require('right_bar.php');
$x['AddTitle'] .= $this->lang->line('mem.3.allmember');

/* Load CSS */
$tmp = array('a:c:table-style');
$x['AddHead'] .= $this->bee->AddCss($tmp);
unset($tmp);
// Load CSS
/* Load JavaScript
  $tmp = array('a:j:jquery.validationEngine-en', 'a:j:jquery.validationEngine', 'a:j:ui:minified:jquery.ui.core.min', 'a:j:ui:minified:jquery.ui.datepicker.min');
  $bf['AddFoot'] .= $this->bee->AddJava($tmp);
  unset($tmp);
  // Load JavaScript */

$x['AddCss'] .= '';
$bf['AddHeadJquery'] .= '';

$x['headlink'] = $this->lang->line('mem.3.allmember');

$this->admin->view('_head', $x);
unset($x);
?>
<div id="rightnow">
    <h3 class="reallynow">
        <span><?php echo $this->lang->line("mem.3.allmember"); ?></span>

        <br />
    </h3>
    <p></p>
</div>
<table class="btable">
    <thead>
        <tr>
            <th><?php echo $this->lang->line('mem.60.id'); ?></th>
            <th><?php echo $this->lang->line('mem.61.user'); ?></th>
            <th><?php echo $this->lang->line('mem.62.email'); ?></th>
            <th><?php echo $this->lang->line('mem.63.group'); ?></th>
            <th><?php echo $this->lang->line('mem.64.active'); ?></th>
            <th><?php echo $this->lang->line('mem.65.edit'); ?></th>
        </tr>
    </thead>
    <tbody>
        <?php
        foreach ($member as $k) {
 ?>
            <tr>
                <td><?php echo $k['id'] ?></td>
                <td><?php echo $k['username'] ?></td>
                <td><?php echo $k['email'] ?></td>
                <td><?php echo $group[$k['memgroup']] ?></td>
                <td><?php echo $k['activated'] ?></td>
                <td><?php 
                if($k['activated']){
                    echo anchor('member/admin/view_member/'.$k['id'],'[view]','class="bsp bicon s-zoom"') ;
                } else {
                    echo anchor('member/admin/activate_user/'.$k['id'],$this->lang->line('mem.92.activate'),'class="bsp bicon s-tick"') ;
                }
                ?></td>
            </tr>
        <?php }
        unset($member,$k);
        ?>

    </tbody>
</table>

<?php
        $this->admin->view('_foot', $bf);
        unset($bf);
?>